package com.jsss.echarts.controller;

import com.jsss.common.ErrorCode;
import com.jsss.common.ResponseModel;
import com.jsss.echarts.entity.Data;
import com.jsss.echarts.service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.HashMap;


@RestController
@RequestMapping("data")
@CrossOrigin(origins = "${jsss.web.path}", allowedHeaders = "*", allowCredentials = "true")
public class DataController implements ErrorCode {

    @Autowired
    DataService dataService;


    @GetMapping("/list")
    public ResponseModel getDataList(){
        HashMap<String, Object> search = dataService.searchMap();
        return new ResponseModel(search);
    }



    @PostMapping("/add")
    public ResponseModel add(Data data){

        return new ResponseModel();
    }



}
